<template>
  <div>
    <el-form
      size="medium"
      label-width="7rem"
    >
      <el-row>
        <el-col
          v-for="(d,n) in data"
          :key="n"
          :span="24"
        >
          <el-form-item
            :label="d.name"
            :prop="n"
          >
            <el-input
              v-model="d.val"
              :style="{ width: '100%' }"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'DataForm',
  props: {
    data: {
      type: Object,
      required: true
    }
  }
}
</script>
